{template order_header.html}

<form class="form-horizontal" action="" method="post" id="myform" name="myform">
    <div class="page-bar">
        <ul class="page-breadcrumb mylink">
            {$menu.link}
        </ul>
        <ul class="page-breadcrumb myname">
            {$menu.name}
        </ul>
        <div class="page-toolbar">
            <div class="btn-group pull-right">
                <button type="button" class="btn green btn-sm btn-outline dropdown-toggle" data-toggle="dropdown" aria-expanded="false" data-hover="dropdown"> {fc_lang('操作菜单')}
                    <i class="fa fa-angle-down"></i>
                </button>
                <ul class="dropdown-menu pull-right" role="menu">
                    {loop $menu.quick $t}
                    <li>
                        <a href="{$t.url}">{$t.icon} {$t.name}</a>
                    </li>
                    {/loop}
                    <li class="divider"> </li>
                    <li>
                        <a href="javascript:window.location.reload();">
                            <i class="icon-refresh"></i> {fc_lang('刷新页面')}</a>
                    </li>
                </ul>
            </div>
        </div>
    </div>

    <h3 class="page-title">
        <small>
            <label>{fc_lang('订单号')}：<a href="javascript:;" class="btn green btn-xs">{$order.sn}</a></label>
            {str_replace(array('<p>', '</p>'), array('<label>', '</label>'), dr_order_member_option($order.sell_uid, $order))}
            <label><a target="_blank" href="{dr_url('order/home/print_info', array('id' => $order.id))}" class="btn blue btn-xs"><i class="fa fa-print"></i> {fc_lang('打印订单')}</a></label>
        </small>
    </h3>

    <div class="portlet light bordered ">
        <div class="portlet-title">
            <div class="caption">
                <span class="caption-subject font-green">{fc_lang('基本信息')}</span>
            </div>
        </div>
        <div class="portlet-body">

            <div class="row" style="clear: both">
                <div class="col-md-6 col-sm-12">
                    <div class="portlet  box">
                        <div class="portlet-body">
                            <div class="row static-info">
                                <div class="col-md-3 name">{fc_lang('订单状态')}：</div>
                                <div class="col-md-9 value"> {dr_order_status($order)}</div>
                            </div>
                            <div class="row static-info">
                                <div class="col-md-3 name"> {fc_lang('下单时间')}：</div>
                                <div class="col-md-9 value"> {dr_date($order.order_time)} </div>
                            </div>
                            <div class="row static-info">
                                <div class="col-md-3 name"> {fc_lang('买家账号')}：</div>
                                <div class="col-md-9 value"> <a href="javascript:;" onclick="dr_dialog_member('{$order.buy_uid}')">{$order.buy_username}</a>  </div>
                            </div>
                            <div class="row static-info">
                                <div class="col-md-3 name"> {fc_lang('商家账号')}：</div>
                                <div class="col-md-9 value"> <a href="javascript:;" onclick="dr_dialog_member('{$order.sell_uid}')">{$order.sell_username}</a> </div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="col-md-6 col-sm-12">
                    <div class="portlet box">
                        <div class="portlet-body">
                            <div class="row static-info">
                                <div class="col-md-3 name"> 订单金额： </div>
                                <div class="col-md-9 value"> {if $order.order_score}{intval($order.order_price)}{SITE_SCORE}{else}¥{number_format($order.order_price, 2)}元 {/if}</div>
                            </div>
                            <div class="row static-info">
                                <div class="col-md-3 name"> 付款时间： </div>
                                <div class="col-md-9 value"> {if $order.pay_time}{dr_date($order.pay_time)}{else}未付款{/if} </div>
                            </div>
                            <div class="row static-info">
                                <div class="col-md-3 name"> 支付方式： </div>
                                <div class="col-md-9 value"> {if $paytype[$order.pay_type]}{$paytype[$order.pay_type]['name']}{else}未知{/if} </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>

        </div>
    </div>

    {if $order.buy_step<2 && $order.shipping_name && $order.shipping_phone}
    <div class="portlet light bordered ">
        <div class="portlet-title">
            <div class="caption">
                <span class="caption-subject font-green">{fc_lang('收货与发货')}</span>
            </div>
        </div>
        <div class="portlet-body">
            <div class="row">
                <div class="col-md-6 col-sm-12">
                    <div class="portlet box">
                        <div class="portlet-body">
                            <div class="row static-info">
                                <div class="col-md-12 value">
                                    <label>{$order.shipping_name}</label>
                                    <label>{$order.shipping_phone}</label>
                                    <label>{$order.shipping_zipcode}</label>
                                    <label>{$order.shipping_city}{$order.shipping_address}</label>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="col-md-6 col-sm-12">
                    <div class="portlet box">
                        <div class="portlet-body">
							
                            {if $order.shipping_time}
                            <div class="row static-info">
                                <div class="col-md-3 name"> {fc_lang('发货时间')}： </div>
                                <div class="col-md-9 value"> {dr_date($order.shipping_time)} </div>
                            </div>
                            <div class="row static-info">
                                <div class="col-md-3 name"> {fc_lang('物流公司')}： </div>
                                <div class="col-md-9 value"> {if $kd[$order.shipping_type]}{$kd[$order.shipping_type]}{else}无{/if} </div>
                            </div>
                            {if $order.shipping_sn}
                            <div class="row static-info">
                                <div class="col-md-3 name"> {fc_lang('运输单号')}： </div>
                                <div class="col-md-9 value"> {$order.shipping_sn}


                                    <span id="kd_info"> </span>
                                    <script>
                                        $(function(){
                                            $.get("{dr_url('order/home/kd')}&name={$order.shipping_type}&sn={$order.shipping_sn}", function(data){
                                                $('#kd_info').html(data);
                                            });
                                        });
                                    </script>
                                </div>
                            </div>
                            {/if}
                            {else}
                            <a href="javascript:;" onclick="dr_order_shipping({$order.id})" class="btn green btn-xs"> <i class="fa fa-truck"></i> {fc_lang('立即发货')}</a>
                            {/if}
							
							{if $order.shipping_stime}
							<div class="row static-info">
								<div class="col-md-3 name"> {fc_lang('收货时间')}： </div>
								<div class="col-md-9 value"> {dr_date($order.shipping_stime)} </div>
							</div>
							{/if}
                        </div>
                    </div>
                </div>
            </div>

        </div>
    </div>
    {/if}

    <div class="portlet light bordered ">
        <div class="portlet-body">

            <table class="table ">
                <thead>
                <tr>
                    <th width="90"> </th>
                    <th> 商品名称 </th>
                    <th> 商品规格 </th>
                    <th> 商品编号 </th>
                    <th width="90"> 价格 </th>
                    <th width="60"> 数量 </th>
                </tr>
                </thead>
                <tbody>
                {loop $order.goods $t}
                <tr>
                    <td>
                        <a target="_blank" href="{$t.url}"><img src="{dr_thumb($t.thumb, 50, 50)}" width="50"></a>
                    </td>
                    <td>
                        <a target="_blank" href="{$t.url}">{$t.title} </a>
                    </td>
                    <td><?php $sku=dr_string2array($t.sku);?>
                        {if $sku}
                        {loop $sku $s $u}<span>{$s}：{$u} </span>{/loop}
                        {/if}
                    <td>{$t.sn}</td>
                    <td> {if $order.order_score}{intval($t.price)}{SITE_SCORE}{else}¥{number_format($t.price, 2)}{/if}</td>
                    <td> {$t.quantity}</td>
                </tr>
                {/loop}

                </tbody>
            </table>
            <div class="row" style="margin-top: 10px;">
                <div class="col-md-12 ">{fc_lang('买家备注')}：{$order.buy_note}</div>
            </div>
        </div>
    </div>

    <div class="portlet light bordered ">
        <div class="portlet-title">
            <div class="caption">
                <span class="caption-subject font-green">{fc_lang('费用信息')}</span>
            </div>
        </div>
        <div class="portlet-body">
            {if $order.shipping_price > 0}<p>{fc_lang('运费')}：¥{number_format($order.shipping_price, 2)} </p>{/if}
            <p>{fc_lang('应付总额')}：{if $order.order_score}{intval($order.order_price)}{SITE_SCORE}{else}¥{number_format($order.order_price, 2)} {/if}</p>

        </div>
    </div>

    <div class="portlet light bordered ">
        <div class="portlet-title">
            <div class="caption">
                <span class="caption-subject font-green">{fc_lang('操作信息')}</span>
            </div>
        </div>
        <div class="portlet-body">
            <div class="row">
                <div class="col-md-12 ">{fc_lang('卖家备注')}：{$order.sell_note}</div>
            </div>
            <table class="table" style="margin-top: 20px;">
                <thead>
                <tr>
                    <th width="150">时间</th>
                    <th width="120">地点</th>
                    <th>订单状态</th>
                    <th width="120">操作人</th>
                    <th>说明</th>
                </tr>
                </thead>
                <tbody>
                {loop $log $t}
                <tr>
                    <td>{dr_date($t.inputtime)}</td>
                    <td>{$ci->dip->address($t.inputip)}</td>
                    <td>{dr_order_member_status($t.order_status)}</td>
                    <td>{$t.username}</td>
                    <td>{$t.note}</td>
                </tr>
                {/loop}
                </tbody>
            </table>
        </div>
    </div>


</form>
{template nfooter.html}